<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <link href="/assets/index/css/MyCenter.css" rel="stylesheet" />
    <link href="/assets/index/css/mui/mui.min.css" rel="stylesheet" />
    <link href="/assets/index/css/WeUI/weui.min.css" rel="stylesheet" />
    <title>我的订单</title>
    <style>
        body {
            font-family: 'Microsoft YaHei';
        }

        p {
            font-size: 4.5vw;
        }
    </style>
</head>

<body>
    <div class="top_div">
        <img src="/assets/index/images/bac.jpg" class="top_img">
        <div class="userInfo">
            <img class="uPic" src="/assets/index/images/pexels-spencer-selover-428364.jpg" /><br />
            <span class="uBalance" style="color: rgb(74, 70, 66); ">Jack</span>
        </div>
    </div>
    <div class="page__bd" style="height: 100%;">
        <div class="weui-tab">
            <div class="weui-navbar">
                <div class="weui-navbar__item weui-bar__item_on" id="order">
                    视频购买记录
                </div>
                <div class="weui-navbar__item" id="record">
                    会员消费记录
                </div>
            </div>
            <div class="weui-tab__panel">
                <div id="o1">
                    {foreach $order_list as $item}
                    <div class="weui-form-preview">
                        <div class="weui-form-preview__hd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">订单金额</label>
                                <span class="weui-form-preview__value">{$item.total}</span>
                            </div>
                        </div>
                        <div class="weui-form-preview__bd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">课程名称</label>
                                <span class="weui-form-preview__value">{$item.subject.title}</span>
                            </div>
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">购买时间</label>
                                <span class="weui-form-preview__value">{$item['createtime']|date="Y-m-d
                                    H:i:s",###}</span>
                            </div>
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">课程简介</label>
                                <span class="weui-form-preview__value">{$item.subject.content}</span>
                            </div>
                        </div>
                        <div class="weui-form-preview__ft">
                            <a class="weui-form-preview__btn weui-form-preview__btn_default"
                                href="{:url('/index/business/Business/comment',['subid'=>$item['subid']])}">评价</a>
                            <a class="weui-form-preview__btn weui-form-preview__btn_primary"
                                href="./video-playing.html">立即查看</a>
                        </div>
                    </div><br />
                    {/foreach}
                </div>
                <div id="o2" style="display:none;">
                    {foreach $record_list as $item}
                    <div class="weui-form-preview">
                        <div class="weui-form-preview__hd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">订单金额</label>
                                <em class="weui-form-preview__value">¥{$item.total}</em>
                            </div>
                        </div>
                        <div class="weui-form-preview__bd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">订单详情</label>
                                <span class="weui-form-preview__value">{$item.content}</span>
                            </div>
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">购买时间</label>
                                <span class="weui-form-preview__value">{$item['createtime']|date="Y-m-d
                                    H:i:s",###}</span>
                            </div>
                        </div>
                    </div><br />
                    {/foreach}
                </div>
            </div>
        </div>
    </div>
    <script src="/assets/index/js/jquery-1.9.1.min.js"></script>
    <script>
        $('#order').click(function () {
            $('#order').addClass('weui-bar__item_on').siblings().removeClass('weui-bar__item_on')
            $.ajax({
                url: `{:url('/index/Business/Business/order')}`,
                data: {
                    action: 'order'
                },
                type: 'post',
                dataType: 'json',
                success: function (success) {
                    $("#o1").css('display', 'block'),
                        $("#o2").css('display', 'none')
                },
            })
        })
        $('#record').click(function () {
            $('#record').addClass('weui-bar__item_on').siblings().removeClass('weui-bar__item_on')
            $.ajax({
                url: `{:url('/index/Business/Business/order')}`,
                data: {
                    action: 'record'
                },
                type: 'post',
                dataType: 'json',
                success: function (success) {
                    $("#o2").css('display', 'block'),
                        $("#o1").css('display', 'none')
                },
            })
        })
    </script>
</body>

</html>